﻿using System;
using System.Data;
using System.Data.Common;
using QzEbook.Common;
using QzEbook.Common.Emum;

/// <summary>
///Hit 的摘要说明
/// </summary>
/// 
namespace QzEbook.AccessObject
{
    public class Hit : abstractAccess<Hit>
    {
        private HitAction type = HitAction.HitDetail;

        public HitAction Type
        {
            get { return type; }
            set { type = value; }
        }

        private int tId;

        public int TId
        {
            get { return tId; }
            set { tId = value; }
        }
        private int bId;

        public int BId
        {
            get { return bId; }
            set { bId = value; }
        }
        public Hit()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }

        public override bool update()
        {
            DbCommand command = CreateCommand("AddHit");
            addParameter(command,"@BID",BId);
            addParameter(command, "@TID", TId);
            addParameter(command, "@Type", Type);
            int i=-1;
            try
            {
                i = DataAccess.ExecuteNonQuery(command);
            }
            catch
            {
            }
            return (i != -1);
        }

        protected override Hit bindRow(DataRow row)
        {
            throw new NotImplementedException();
        }

        protected override DataTable selectTable()
        {
            throw new NotImplementedException();
        }
    }
}
